using System;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;


namespace GameLib.GameSprite
{
    class ASprite
    {

        #region Properties
        protected Texture2D Texture;
        protected Vector2 position;

        public int TextureHeight
        {
            get { return Texture.Height; }
        }

        public int TextureWidth
        {
            get { return Texture.Width; }
        }

        public Point TextureSize
        {
            get { return new Point(Texture.Width, Texture.Height); }
        }

        public Vector2 Position
        {
            get { return position; }
            set { position = value; }
        }

        public float PositionX
        {
            get { return position.X; }
            set { position.X = value; }
        }

        public float PositionY
        {
            get { return position.Y; }
            set { position.Y = value; }
        }
        #endregion

        public void MoveX(bool isRight, int value)
        {
            if (isRight)
            {
                position.X += value;
            }
            else
            {
                position.X -= value;
            }
        }

        public void MoveY(bool isDown, int value)
        {
            if (isDown)
            {
                position.Y += value;
            }
            else
            {
                position.Y -= value;
            }
        }

        public ASprite(Texture2D texture, Vector2 position)
        {
            this.Texture = texture;
            this.position = position;
        }

        public virtual void Draw(SpriteBatch sp)
        {
            sp.Draw(Texture, position, Color.White);
        }

        public virtual void Draw(SpriteBatch sp, Vector2 vPos)
        {
            sp.Draw(Texture, vPos, Color.White);
        }
    }
}
